package com.romaremez.testuser.tests;

import com.romaremez.testuser.src.datautils.DataLoader;
import com.romaremez.testuser.src.testsystem.DataBase;
//import com.romaremez.testuser.src.userdata.SessionHandler;
import com.romaremez.testuser.src.userdata.User;
import com.romaremez.testuser.src.userdata.UserSession;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

import java.util.List;
import java.util.Map;

public class UserSessionTestTest {
    private UserSession defaultSession;
    User user;

    @Before
    public void setUp() {
        user = new User("jack", "1234");
        defaultSession = new DataBase().getSession(user);
    }

    @Test
    public void testGetSessionNotNull() throws Exception {
        assertNotNull("must be not null", defaultSession);
    }

    @Test
    public void testGetSessionNotFinishedSession() throws Exception {
        assertFalse("must be session which is not finished", defaultSession.isFinished());
    }
    @Test
    public void testGetSessionFinishSession() throws Exception {
        defaultSession.finishSession();
        assertTrue("session must be finished", defaultSession.isFinished());
    }

    @Test
    public void testSizeOfNewSession() {
        assertEquals("must be zero", 0, defaultSession.size());
    }
}
